Integrand size = 33, antiderivative size = 303 \[ \int \cos ^2(c+d x) \sqrt {a+b \cos (c+d x)} (A+B \cos (c+d x)) \, dx=-\frac {2 \left (14 a^2 A b-63 A b^3-8 a^3 B-19 a b^2 B\right ) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{105 b^3 d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}+\frac {2 \left (a^2-b^2\right ) \left (14 a A b-8 a^2 B-25 b^2 B\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),\frac {2 b}{a+b}\right )}{105 b^3 d \sqrt {a+b \cos (c+d x)}}-\frac {2 \left (14 a A b-8 a^2 B-25 b^2 B\right ) \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{105 b^2 d}+\frac {2 (7 A b-4 a B) (a+b \cos (c+d x))^{3/2} \sin (c+d x)}{35 b^2 d}+\frac {2 B \cos (c+d x) (a+b \cos (c+d x))^{3/2} \sin (c+d x)}{7 b d} \]
[Out]
Time = 0.60 (sec) , antiderivative size = 303, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.242, Rules used = {3069, 3102, 2832, 2831, 2742, 2740, 2734, 2732} \[ \int \cos ^2(c+d x) \sqrt {a+b \cos (c+d x)} (A+B \cos (c+d x)) \, dx=-\frac {2 \left (-8 a^2 B+14 a A b-25 b^2 B\right ) \sin (c+d x) \sqrt {a+b \cos (c+d x)}}{105 b^2 d}+\frac {2 \left (a^2-b^2\right ) \left (-8 a^2 B+14 a A b-25 b^2 B\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),\frac {2 b}{a+b}\right )}{105 b^3 d \sqrt {a+b \cos (c+d x)}}-\frac {2 \left (-8 a^3 B+14 a^2 A b-19 a b^2 B-63 A b^3\right ) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{105 b^3 d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}+\frac {2 (7 A b-4 a B) \sin (c+d x) (a+b \cos (c+d x))^{3/2}}{35 b^2 d}+\frac {2 B \sin (c+d x) \cos (c+d x) (a+b \cos (c+d x))^{3/2}}{7 b d} \]
[In]
[Out]
Rule 2732
Rule 2734
Rule 2740
Rule 2742
Rule 2831
Rule 2832
Rule 3069
Rule 3102
Rubi steps \begin{align*} \text {integral}& = \frac {2 B \cos (c+d x) (a+b \cos (c+d x))^{3/2} \sin (c+d x)}{7 b d}+\frac {2 \int \sqrt {a+b \cos (c+d x)} \left (a B+\frac {5}{2} b B \cos (c+d x)+\frac {1}{2} (7 A b-4 a B) \cos ^2(c+d x)\right ) \, dx}{7 b} \\ & = \frac {2 (7 A b-4 a B) (a+b \cos (c+d x))^{3/2} \sin (c+d x)}{35 b^2 d}+\frac {2 B \cos (c+d x) (a+b \cos (c+d x))^{3/2} \sin (c+d x)}{7 b d}+\frac {4 \int \sqrt {a+b \cos (c+d x)} \left (\frac {1}{4} b (21 A b-2 a B)-\frac {1}{4} \left (14 a A b-8 a^2 B-25 b^2 B\right ) \cos (c+d x)\right ) \, dx}{35 b^2} \\ & = -\frac {2 \left (14 a A b-8 a^2 B-25 b^2 B\right ) \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{105 b^2 d}+\frac {2 (7 A b-4 a B) (a+b \cos (c+d x))^{3/2} \sin (c+d x)}{35 b^2 d}+\frac {2 B \cos (c+d x) (a+b \cos (c+d x))^{3/2} \sin (c+d x)}{7 b d}+\frac {8 \int \frac {\frac {1}{8} b \left (49 a A b+2 a^2 B+25 b^2 B\right )-\frac {1}{8} \left (14 a^2 A b-63 A b^3-8 a^3 B-19 a b^2 B\right ) \cos (c+d x)}{\sqrt {a+b \cos (c+d x)}} \, dx}{105 b^2} \\ & = -\frac {2 \left (14 a A b-8 a^2 B-25 b^2 B\right ) \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{105 b^2 d}+\frac {2 (7 A b-4 a B) (a+b \cos (c+d x))^{3/2} \sin (c+d x)}{35 b^2 d}+\frac {2 B \cos (c+d x) (a+b \cos (c+d x))^{3/2} \sin (c+d x)}{7 b d}+\frac {\left (\left (a^2-b^2\right ) \left (14 a A b-8 a^2 B-25 b^2 B\right )\right ) \int \frac {1}{\sqrt {a+b \cos (c+d x)}} \, dx}{105 b^3}-\frac {\left (14 a^2 A b-63 A b^3-8 a^3 B-19 a b^2 B\right ) \int \sqrt {a+b \cos (c+d x)} \, dx}{105 b^3} \\ & = -\frac {2 \left (14 a A b-8 a^2 B-25 b^2 B\right ) \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{105 b^2 d}+\frac {2 (7 A b-4 a B) (a+b \cos (c+d x))^{3/2} \sin (c+d x)}{35 b^2 d}+\frac {2 B \cos (c+d x) (a+b \cos (c+d x))^{3/2} \sin (c+d x)}{7 b d}-\frac {\left (\left (14 a^2 A b-63 A b^3-8 a^3 B-19 a b^2 B\right ) \sqrt {a+b \cos (c+d x)}\right ) \int \sqrt {\frac {a}{a+b}+\frac {b \cos (c+d x)}{a+b}} \, dx}{105 b^3 \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}+\frac {\left (\left (a^2-b^2\right ) \left (14 a A b-8 a^2 B-25 b^2 B\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}}\right ) \int \frac {1}{\sqrt {\frac {a}{a+b}+\frac {b \cos (c+d x)}{a+b}}} \, dx}{105 b^3 \sqrt {a+b \cos (c+d x)}} \\ & = -\frac {2 \left (14 a^2 A b-63 A b^3-8 a^3 B-19 a b^2 B\right ) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{105 b^3 d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}+\frac {2 \left (a^2-b^2\right ) \left (14 a A b-8 a^2 B-25 b^2 B\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),\frac {2 b}{a+b}\right )}{105 b^3 d \sqrt {a+b \cos (c+d x)}}-\frac {2 \left (14 a A b-8 a^2 B-25 b^2 B\right ) \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{105 b^2 d}+\frac {2 (7 A b-4 a B) (a+b \cos (c+d x))^{3/2} \sin (c+d x)}{35 b^2 d}+\frac {2 B \cos (c+d x) (a+b \cos (c+d x))^{3/2} \sin (c+d x)}{7 b d} \\ \end{align*}
Time = 0.98 (sec) , antiderivative size = 232, normalized size of antiderivative = 0.77 \[ \int \cos ^2(c+d x) \sqrt {a+b \cos (c+d x)} (A+B \cos (c+d x)) \, dx=\frac {4 \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \left (b^2 \left (49 a A b+2 a^2 B+25 b^2 B\right ) \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),\frac {2 b}{a+b}\right )+\left (-14 a^2 A b+63 A b^3+8 a^3 B+19 a b^2 B\right ) \left ((a+b) E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )-a \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),\frac {2 b}{a+b}\right )\right )\right )+b (a+b \cos (c+d x)) \left (\left (28 a A b-16 a^2 B+115 b^2 B\right ) \sin (c+d x)+3 b (2 (7 A b+a B) \sin (2 (c+d x))+5 b B \sin (3 (c+d x)))\right )}{210 b^3 d \sqrt {a+b \cos (c+d x)}} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(1304\) vs. \(2(337)=674\).
Time = 15.46 (sec) , antiderivative size = 1305, normalized size of antiderivative = 4.31
method | result | size |
default | \(\text {Expression too large to display}\) | \(1305\) |
parts | \(\text {Expression too large to display}\) | \(1494\) |
[In]
[Out]
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 0.14 (sec) , antiderivative size = 561, normalized size of antiderivative = 1.85 \[ \int \cos ^2(c+d x) \sqrt {a+b \cos (c+d x)} (A+B \cos (c+d x)) \, dx=\frac {\sqrt {2} {\left (16 i \, B a^{4} - 28 i \, A a^{3} b + 32 i \, B a^{2} b^{2} - 21 i \, A a b^{3} - 75 i \, B b^{4}\right )} \sqrt {b} {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) + 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right ) + \sqrt {2} {\left (-16 i \, B a^{4} + 28 i \, A a^{3} b - 32 i \, B a^{2} b^{2} + 21 i \, A a b^{3} + 75 i \, B b^{4}\right )} \sqrt {b} {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) - 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right ) - 3 \, \sqrt {2} {\left (-8 i \, B a^{3} b + 14 i \, A a^{2} b^{2} - 19 i \, B a b^{3} - 63 i \, A b^{4}\right )} \sqrt {b} {\rm weierstrassZeta}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) + 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right )\right ) - 3 \, \sqrt {2} {\left (8 i \, B a^{3} b - 14 i \, A a^{2} b^{2} + 19 i \, B a b^{3} + 63 i \, A b^{4}\right )} \sqrt {b} {\rm weierstrassZeta}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) - 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right )\right ) + 6 \, {\left (15 \, B b^{4} \cos \left (d x + c\right )^{2} - 4 \, B a^{2} b^{2} + 7 \, A a b^{3} + 25 \, B b^{4} + 3 \, {\left (B a b^{3} + 7 \, A b^{4}\right )} \cos \left (d x + c\right )\right )} \sqrt {b \cos \left (d x + c\right ) + a} \sin \left (d x + c\right )}{315 \, b^{4} d} \]
[In]
[Out]
\[ \int \cos ^2(c+d x) \sqrt {a+b \cos (c+d x)} (A+B \cos (c+d x)) \, dx=\int \left (A + B \cos {\left (c + d x \right )}\right ) \sqrt {a + b \cos {\left (c + d x \right )}} \cos ^{2}{\left (c + d x \right )}\, dx \]
[In]
[Out]
\[ \int \cos ^2(c+d x) \sqrt {a+b \cos (c+d x)} (A+B \cos (c+d x)) \, dx=\int { {\left (B \cos \left (d x + c\right ) + A\right )} \sqrt {b \cos \left (d x + c\right ) + a} \cos \left (d x + c\right )^{2} \,d x } \]
[In]
[Out]
\[ \int \cos ^2(c+d x) \sqrt {a+b \cos (c+d x)} (A+B \cos (c+d x)) \, dx=\int { {\left (B \cos \left (d x + c\right ) + A\right )} \sqrt {b \cos \left (d x + c\right ) + a} \cos \left (d x + c\right )^{2} \,d x } \]
[In]
[Out]
Timed out. \[ \int \cos ^2(c+d x) \sqrt {a+b \cos (c+d x)} (A+B \cos (c+d x)) \, dx=\int {\cos \left (c+d\,x\right )}^2\,\left (A+B\,\cos \left (c+d\,x\right )\right )\,\sqrt {a+b\,\cos \left (c+d\,x\right )} \,d x \]
[In]
[Out]